Method for synchronization in a local area network including a store-and-forward device

ABSTRACT

The present invention relates to a method for identifying inaccurate time measurements in a local area network. The local area network comprises a sending device ( 2 ), such as a time client, a destination device ( 3 ), such as a timeserver, and a switching device and/or a store-and-forward device ( 6 ). A time request packet ( 4 ) is rejected if it arrives at the time client or timeserver within a given or calculated minimum distance from the preceding network packet. The time request packet ( 4 ) is also rejected if it falls outside a set of calculated error limits based on a set of estimates. Those estimates are kept in the time client memory and updated according to a given set of rules.

FIELD OF THE INVENTION

A method for identifying inaccurate time measurements in a local areanetwork incorporating a central switch and/or a store-and-forwarddevice.

BACKGROUND OF THE INVENTION

Several schemes exist for synchronizing a time-of-day clock in one node,such as a time client, to a reference time-of-day clock in another node,such as a timeserver, over a local area network (LAN). Most of thetime-of-day clocks attain their stated accuracy only when a networktransfer delay between the time client and the timeserver is constant.Introduction of switched Ethernet created a class of local area networkswhere network capacity was greatly enhanced at the expense of apredictable delay between the time one network node transmits a timerequest packet and the time the destination node receives it. A reasonfor this is that the link to the destination node may be busy with otherpackets when the aforesaid packet is ready to be placed on that link. Insuch cases the packet is stored in the switch, which therefore is also astore-and-forward device, until the link to the destination node isfree.

SUMMARY OF THE INVENTION

The object of the invention is to provide a method for identifyinginaccurate time measurements in a local area network incorporating acentral switch and/or a store-and-forward device.

This object is achieved by a method according to the independent claims1 and 2.

A network incorporating a store-and-forward device, like the switch in aswitched Ethernet network, has two distinct sources of delay. The firstsource of delay is the connection from the sending device, such as thetime client, to the store-and-forward device and the second source ofdelay is the connection from the store-and-forward device to thedestination device, such as the time server 4. This invention willaddress both sources, using two distinct algorithms.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic block diagram of a computer network, such as aLAN, comprising a time client, a timeserver and a central switch and/ora store-and forward device.

FIG. 2 shows an example of normal packet arrivals and queued packetarrivals.

FIG. 3 shows an example of accepting or rejecting a measurement based onestimates.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 shows a schematic block-diagram of a computer network 1, such asa local area network, comprising a time client 2 and a timeserver 3. Aswitching device and/or a store-and-forward device 6 are/is in the pathbetween the time client and the timeserver. A time request packet 4 istransmitted from the time client 2 to the timeserver 3 and from thetimeserver to the time client.

It is presupposed that the time request packets 4 are time stamped atthe end of the time request packets. The reason for this is that it isonly ensured that a time request packet has been fully received ortransmitted at the end of the time request packet. If the time requestpacket is time stamped before the end, the time request packet might beaborted before transmission or reception has been completed.

In the following examples the time client 2 is working as a sendingdevice and the timeserver 3 is working as a destination device. Thisshould be seen as an example only. When the time request packet 4 istransferred from the timeserver 3 to the time client 2 the timeserver isworking as a sending device and the time client is working as adestination device

When a time request packet 4 is transmitted from the store-and-forwarddevice 6 to the timeserver 3, i.e. the destination device, the timerequest packet might be stored in the store-and-forward device 6 waitingfor other packets to finish using the link to the timeserver. The timerequest packet 4 will be sent as soon as possible. This means that itwill be sent after the preceding packet followed by a specified MinimumInterpacket Gap, shown in FIG. 2. The specified Minimum Interpacket Gapfor Ethernet is given by the IEEE 802.3 and ISO 8802/3 standards. Sincethe length of the time synchronization packet is known as well as thelength of the additional bits associated with packet transmission, suchas preamble, checksum etc., a minimum time distance between the end ofthe preceding packet and the end of the time synchronization packet maybe calculated. The time distance between the end of the preceding packetand the end of the time request packet 4 is measured in the destinationdevice, in this example the timeserver 3. If the measured time distanceis within a given tolerance of this minimum time distance t, it isconcluded that the time request packet 4 was delayed in the switchand/or the store-and-forward device and therefore the time measurementassociated with it will be inaccurate. The delayed packet will not beused for time calculations. FIG. 2 shows an example of normal timerequest packet arrivals A and queued time request packets arrival B.

If the measured time distance is greater than the Minimum InterpacketGap the time request packet 4 has not been delayed in the switch and/orstore-and-forward device and the time stamps may be used to synchronizethe time client 2 and the time server 3.

If there are delays on the link from the sending device to thestore-and-forward device, an alternative procedure for validating thetime stamp accuracy must be used.

FIG. 3 shows how the time stamp accuracy is validated when it has been adelay on the link 1 from the sending device, for example, the timeclient 2, to the switching device and/or store-and-forward device. Thisprocedure is based on a certain degree of confidence in the localtime-of-day clock. This confidence is expressed in four variables:estimated relative local frequency deviation dfR, estimated localfrequency accuracy d2fR, estimated local time precision dtP and aconfidence level. Start values for the estimated relative localfrequency deviation dfR and the estimated local frequency accuracy d2fRare stored in the time client when the time client is manufactured,together with a comparison value for the confidence level variable. Theconfidence level variable always starts at 0 and as long as it is lessthan the comparison value, there is a low confidence in the estimates.When the confidence level variable is greater than or equal to thecomparison value, there is a high confidence in the estimates.

When a new time adjustment tA is calculated from the time stamps, it isdecided whether to keep the adjustment or reject it according to, forexample, the following algorithm:

1. First an upper acceptance level tH or a lower acceptance level tL forthe new time adjustment tA is calculated:tB=tP+(tR−tP)*(1+dfR)dtB=dtP+(tR−tP)*d 2 fRtH=tB+dtBtL=tB−dtBwhere tP is the value of the local clock at a previously accepted timeadjustment, tR is the value of the local clock at the current timerequest, dfR is the estimated relative local frequency deviation, dtP isthe estimated local time precision at the previously accepted timeadjustment and d2fR is the estimated local frequency accuracy at thesame point in time. The range between the upper acceptance level tH andthe lower acceptance level tL is called the error range.

2. If tA falls within the error range, tA is accepted and used to updatelocal time, estimated local frequency and estimated frequency drift. Inaddition, the confidence level is increased up to a predefined limit.

3. If there is a high confidence in our estimates and tA does not fallwithin the error range, tA is rejected and the confidence level in ourestimates is decreased to a value greater than 0.

4. If there is a low confidence in our estimates and tA does not fallwithin the error range, there are several options. A first option is toreject tA, decrease the confidence level and hope for a better tA in thefuture.

A second option is to introduce a new set of estimates together with atime-of-day offset. When the new set of estimates has been introducedevery new time adjustment tA must be checked against every set ofestimates until one of the confidence levels becomes high. At that pointin time, that set of estimates is kept and the others are deleted. Thenext time adjustment tA will fulfill the requirements in either the timeclient 2 or the timeserver 3.

1. A method for identifying inaccurate time measurements when runningtime synchronization on a local area network, the local area networkcomprising a sending device, a destination device and a switching deviceand/or a store-and-forward device arranged on a path between the sendingdevice and the destination device, the method comprising: storing avalue for an estimated relative local frequency deviation (dfR) and aconfidence comparison value for a local time-of-day clock in a memory inthe sending device; obtaining a time value (tP) of the local time-of-dayclock at a previous time adjustment; obtaining an estimated localfrequency accuracy (d2fR) at the previous time adjustment; obtaining anestimated local time precision (dtP) at the previous time adjustment;receiving time stamps; calculating a new time adjustment (tA) from thereceived time stamps; obtaining a time value (tR) of the localtime-of-day clock for the new time adjustment (tA); calculating an upperacceptance level (tH) and a lower acceptance level (tL) for the new timeadjustment (tA) based on the following equations:tH=tB+dtBtL=tB−dtB where tB=tP+(tR−tP)*(1+dfR) and dtB=dtP+(tR−tP)*d2fR; anddetermining whether the new time adjustment (tA) falls between tH andtL.
 2. The method of claim 1, wherein the sending device is a timeclient.
 3. The method of claim 1, further comprising: if the new timeadjustment (tA) falls between tH and tL, accepting the new timeadjustment (tA) and updating the time value of the local time-of-dayclock.
 4. A method for identifying inaccurate time measurements whenrunning time synchronization on a local area network, the local areanetwork comprising a sending device, a destination device and aswitching device and/or a store-and-forward device connected between thesending device and the destination device, the method comprising:receiving a network packet and then a time request packet at thedestination device; measuring the time between the received networkpacket and the received time request packet; and rejecting the receivedtime request packet if the measured time is within a predetermined timeinterval, wherein the predetermined time interval is calculated using aknown length of a time request packet and a required inter-packet gap.5. The method of claim 4, wherein the step of calculating thepredetermined time interval comprises calculating a minimum timeinterval using the known length of a time request and the requiredinter-packet gap and adding a tolerance to the minimum time interval.